
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module lib</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>lib</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/media/sf_svns/occams/trunk/knife/lib.py">/media/sf_svns/occams/trunk/knife/lib.py</a></font></td></tr></table>
    <p><tt>Misc&nbsp;utils.<br>
&nbsp;<br>
This&nbsp;code&nbsp;is&nbsp;part&nbsp;of&nbsp;KNIFE:&nbsp;cropping&nbsp;complexity,&nbsp;culling&nbsp;confusion,&nbsp;<br>
and&nbsp;cutting&nbsp;the&nbsp;crap&nbsp;since&nbsp;2012<br>
&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.----------------._________________<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|=()=========---&nbsp;&nbsp;\-----------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`\&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;jgs&nbsp;&nbsp;\_________________/^^^^^^^^^^^^^^^^^^<br>
&nbsp;<br>
(c)&nbsp;2012,&nbsp;Tim&nbsp;Menzies,&nbsp;tim@menzies.us,&nbsp;LGPL&nbsp;v3.0</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="math.html">math</a><br>
</td><td width="25%" valign=top><a href="re.html">re</a><br>
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-chunks"><strong>chunks</strong></a>(l, n)</dt><dd><tt>Divide&nbsp;'l'&nbsp;into&nbsp;sub-lists&nbsp;of&nbsp;length&nbsp;'n'.</tt></dd></dl>
 <dl><dt><a name="-egs"><strong>egs</strong></a>(*lst)</dt><dd><tt>Runs&nbsp;a&nbsp;list&nbsp;of&nbsp;functions.</tt></dd></dl>
 <dl><dt><a name="-hasArgs"><strong>hasArgs</strong></a>()</dt><dd><tt>Returns&nbsp;true&nbsp;if&nbsp;the&nbsp;first&nbsp;arg&nbsp;has&nbsp;the&nbsp;form&nbsp;-com.</tt></dd></dl>
 <dl><dt><a name="-medianSorted"><strong>medianSorted</strong></a>(lst)</dt><dd><tt>Returns&nbsp;the&nbsp;median&nbsp;value&nbsp;of&nbsp;a&nbsp;list.</tt></dd></dl>
 <dl><dt><a name="-nump"><strong>nump</strong></a>(s)</dt><dd><tt>Return&nbsp;a&nbsp;float&nbsp;or&nbsp;None.</tt></dd></dl>
 <dl><dt><a name="-percentiles"><strong>percentiles</strong></a>(l, bars, show, sort<font color="#909090">=True</font>, filter<font color="#909090">=&lt;function &lt;lambda&gt;&gt;</font>)</dt><dd><tt>Return&nbsp;the&nbsp;breaks&nbsp;seen&nbsp;after&nbsp;'l'&nbsp;is&nbsp;divided&nbsp;into&nbsp;'bars'&nbsp;blocks.</tt></dd></dl>
 <dl><dt><a name="-rows"><strong>rows</strong></a>(file, n<font color="#909090">=0</font>, bad<font color="#909090">='["<font color="#c040c0">\\\'</font> <font color="#c040c0">\\</font>t<font color="#c040c0">\\</font>r<font color="#c040c0">\\</font>n]'</font>, sep<font color="#909090">=','</font>)</dt><dd><tt>Generator&nbsp;for&nbsp;reading&nbsp;csv&nbsp;files.&nbsp;Returns&nbsp;each&nbsp;line,<br>
and&nbsp;its&nbsp;line&nbsp;number&nbsp;(split&nbsp;on&nbsp;'sep',&nbsp;with&nbsp;all&nbsp;the&nbsp;<br>
'bad'&nbsp;stuff&nbsp;deleted).</tt></dd></dl>
 <dl><dt><a name="-runArgs"><strong>runArgs</strong></a>()</dt><dd><tt>Utility&nbsp;for&nbsp;calling&nbsp;functions&nbsp;from&nbsp;command&nbsp;line.<br>
E.g.&nbsp;python&nbsp;file.py&nbsp;-function&nbsp;arg1&nbsp;ag2&nbsp;arg3&nbsp;...<br>
will&nbsp;generate&nbsp;the&nbsp;string&nbsp;&nbsp;function(arg1,arg2,arg3,...).</tt></dd></dl>
 <dl><dt><a name="-s"><strong>s</strong></a>(*lst)</dt><dd><tt>Return&nbsp;'lst'&nbsp;as&nbsp;a&nbsp;string.</tt></dd></dl>
 <dl><dt><a name="-stdev"><strong>stdev</strong></a>(n, s, s2)</dt><dd><tt>Returns&nbsp;standard&nbsp;deviation&nbsp;from&nbsp;'n',&nbsp;the&nbsp;sum&nbsp;of<br>
a&nbsp;sample&nbsp;'s',&nbsp;and&nbsp;the&nbsp;of&nbsp;the&nbsp;squares&nbsp;of&nbsp;a&nbsp;sample&nbsp;'s2'.</tt></dd></dl>
 <dl><dt><a name="-val"><strong>val</strong></a>(x)</dt><dd><tt>Returns&nbsp;a&nbsp;value&nbsp;from&nbsp;'x'&nbsp;(funcalls&nbsp;it&nbsp;if&nbsp;its&nbsp;a&nbsp;function).</tt></dd></dl>
</td></tr></table>
</body></html>